function(head, req) {
	start({
    "headers": {
      "Content-Type": "text/html"
     }
  	});
	var ddoc = this; 
	var Mustache = require("lib/mustache");
	var List = require("vendor/couchapp/lib/list");
	var category = new Array();
	var ind = -1;
	while (row = getRow())
	{
		if(row.key[1] == null)
		{
			ind++;
			category.push(row);
			category[ind].second = new Array();
		}
		else
		{
			category[ind].second.push(row);			
		}
	}
	
	
	
	
	provides("html", function() {		
		var data={
			category:category}
		return Mustache.to_html(ddoc.templates.categorylist, data, ddoc.templates.partials, List.send);   
	});
}